 // 《两只老虎》简谱：http://www.jianpu.cn/pu/33/33945.htm
int g_tiggers_note[] = {
NOTE_C4, NOTE_D4, NOTE_E4, NOTE_C4, 
NOTE_C4, NOTE_D4, NOTE_E4, NOTE_C4, 
NOTE_E4, NOTE_F4, NOTE_G4, 
NOTE_E4, NOTE_F4, NOTE_G4, 
NOTE_G4, NOTE_A4,NOTE_G4, NOTE_F4,NOTE_E4,NOTE_C4,
NOTE_G4,NOTE_A4,NOTE_G4,NOTE_F4,NOTE_E4,NOTE_C4,
NOTE_D4,NOTE_G3,NOTE_C4,0,
NOTE_D4,NOTE_G3,NOTE_C4,0
};
int g_tiggers_duration[] = {
8,8,8,8,
8,8,8,8,
8,8,4,
8,8,4,
8,8,8,8,4,4,
8,8,8,8,4,4,
4,4,4,4,
4,4,4,4
};
// 非简谱歌曲(一系列频率的组合): 生日快乐

int birthday_note[] = {
NOTE_G4,NOTE_G4,
NOTE_A4,NOTE_G4,NOTE_C5,
NOTE_B4,0,NOTE_G4,NOTE_G4,
NOTE_A4,NOTE_G4,NOTE_D5,
NOTE_C5,0,NOTE_G4,NOTE_G4,
NOTE_G5,NOTE_E5,NOTE_C5,
NOTE_B4,NOTE_A4,0,
NOTE_F5,NOTE_F5,
NOTE_E5,NOTE_C5,NOTE_D5,NOTE_C5,0
};  

int birthday_duration[] = {
8,8,4,4,4,4,4,8,8,4,4,4,4,4,8,8,4,4,4,4,2,8,8,8,4,4,4,2,4
};  

int canon_note[]=
{
  NOTE_G5,NOTE_E5,NOTE_F5,NOTE_G5,NOTE_E5,NOTE_F5,
  NOTE_G5,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,
  NOTE_E5,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_E4,NOTE_F4,
  NOTE_G4,NOTE_A4,NOTE_G4,NOTE_F4,NOTE_G4,NOTE_E4,NOTE_F4,NOTE_G4,
  NOTE_F4,NOTE_A4,NOTE_G4,NOTE_F4,NOTE_E4,NOTE_D4,
  NOTE_E4,NOTE_D4,NOTE_C4,NOTE_D4,NOTE_E4,NOTE_F4,NOTE_G4,NOTE_A4,
  NOTE_F4,NOTE_A4,NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5,
  NOTE_G4,NOTE_A4,NOTE_B4,NOTE_C5,NOTE_D5,NOTE_E5,NOTE_F5,NOTE_G5
};
int canon_duration[]=
{
  4,8,8,4,8,8,
  8,8,8,8,8,8,8,8,
  4,8,8,4,8,8,
  8,8,8,8,8,8,8,8,
  4,8,8,4,8,8,
  8,8,8,8,8,8,8,8,
  4,8,8,4,8,8,
  8,8,8,8,8,8,8,8
};

int gourd_note[] = {

    NOTE_C6 , NOTE_C6 , NOTE_F6 , NOTE_C6, NOTE_C6, NOTE_F6 , NOTE_B6  , NOTE_B6  , NOTE_B6  , NOTE_A6 , NOTE_B6  , NOTE_A6 , NOTE_C6, NOTE_F6 , NOTE_D7 , NOTE_B6  , NOTE_B6  , NOTE_A6 , NOTE_B6  , NOTE_A6 , NOTE_C6, NOTE_E6 , NOTE_C7 , NOTE_C7 , NOTE_A6 , NOTE_F6 , NOTE_A6 

};

int gourd_duration[] = {

    4, 4, 8, 2, 4, 4, 4, 4, 2, 2, 4, 2, 4, 8, 2, 2, 2, 2, 8, 2, 4, 4, 4, 2, 2, 4, 16

};  // unit: ms

// 非简谱歌曲(一系列频率的组合): 欢乐颂

int happy_note[] = {

    NOTE_C6, NOTE_C6, NOTE_D6, NOTE_E6, NOTE_E6, NOTE_D6, NOTE_C6, NOTE_B5, NOTE_A5, NOTE_A5, NOTE_B5, NOTE_C6, NOTE_C6, NOTE_B5, NOTE_B5, NOTE_C6, NOTE_C6, NOTE_D6, NOTE_E6, NOTE_E6, NOTE_D6, NOTE_C6, NOTE_B5, NOTE_A5, NOTE_A5, NOTE_B5, NOTE_C6, NOTE_B5, NOTE_A5, NOTE_A5, NOTE_B5, NOTE_B5, NOTE_C6, NOTE_A5, NOTE_B5, NOTE_C6, NOTE_D6, NOTE_C6, NOTE_A5, NOTE_B5, NOTE_C6, NOTE_D6, NOTE_C6, NOTE_B5, NOTE_A5, NOTE_B5, NOTE_E5, NOTE_G5, NOTE_C6, NOTE_C6, NOTE_D6, NOTE_E6, NOTE_E6, NOTE_D6, NOTE_C6, NOTE_D6, NOTE_B5, NOTE_A5, NOTE_A5, NOTE_B5, NOTE_C6, NOTE_B5, NOTE_A5, NOTE_A5

};

int happy_duration[] = {

    4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 2, 8, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 2, 8, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 2, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 2, 4, 4, 4, 4, 6, 2, 8

};  // unit: ms
//##############**"HE IS A PIRATE" Theme song of Pirates of caribbean**##############//
int Pirates_note[] = {
NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4,
NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, 
NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_D4,  
NOTE_A3, NOTE_C4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_E4, NOTE_F4, NOTE_F4, 
NOTE_F4, NOTE_G4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_C4, NOTE_C4, NOTE_D4,
0, NOTE_A3, NOTE_C4, NOTE_B3, NOTE_D4, NOTE_B3, NOTE_E4, NOTE_F4,
NOTE_F4, NOTE_C4, NOTE_C4, NOTE_C4, NOTE_C4, NOTE_D4, NOTE_C4,
NOTE_D4, 0, 0, NOTE_A3, NOTE_C4, NOTE_D4, NOTE_D4, NOTE_D4, NOTE_F4,
NOTE_G4, NOTE_G4, NOTE_G4, NOTE_A4, NOTE_A4, NOTE_A4, NOTE_A4, NOTE_G4,
NOTE_A4, NOTE_D4, 0, NOTE_D4, NOTE_E3, NOTE_F4, NOTE_F4, NOTE_G4, NOTE_A4, 
NOTE_D4, 0, NOTE_D4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_F4, NOTE_D4
};
int Pirates_duration[] = {
4,8,4,8,4,8,8,8,8,4,8,4,8,4,8,8,8,8,4,8,4,8,
4,8,8,8,8,4,4,8,8,4,4,8,8,4,4,8,8,
8,4,8,8,8,4,4,8,8,4,4,8,8,4,4,8,4,
4,8,8,8,8,4,4,8,8,4,4,8,8,4,4,8,8,
8,4,8,8,8,4,4,4,8,4,8,8,8,4,4,8,8
};
//###########End of He is a Pirate song#############//


//##############**"Crazy Frog" song of Crazy frog album**##############//
int CrazyFrog_note[] = {
  NOTE_D4, 0, NOTE_F4, NOTE_D4, 0, NOTE_D4, NOTE_G4, NOTE_D4, NOTE_C4,
  NOTE_D4, 0, NOTE_A4, NOTE_D4, 0, NOTE_D4, NOTE_AS4, NOTE_A4, NOTE_F4,
  NOTE_D4, NOTE_A4, NOTE_D5, NOTE_D4, NOTE_C4, 0, NOTE_C4, NOTE_A3, NOTE_E4, NOTE_D4,
  0,NOTE_D4,NOTE_D4
};
int CrazyFrog_duration[] = {
  8, 8, 6, 16, 16, 16, 8, 8, 8, 
  8, 8, 6, 16, 16, 16, 8, 8, 8,
  8, 8, 8, 16, 16, 16, 16, 8, 8, 2,
  8,4,4
};
//###########End of Crazy Frog#############//



//##############**"Mario underworld" **##############//
int MarioUW_note[] = {
  NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4,NOTE_AS3, NOTE_AS4, 0, 0,
  NOTE_C4, NOTE_C5, NOTE_A3, NOTE_A4, NOTE_AS3, NOTE_AS4, 0,0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,NOTE_DS3, NOTE_DS4, 0, 0,
  NOTE_F3, NOTE_F4, NOTE_D3, NOTE_D4,NOTE_DS3, NOTE_DS4, 0,
  0, NOTE_DS4, NOTE_CS4, NOTE_D4,
  NOTE_CS4, NOTE_DS4, NOTE_DS4, NOTE_GS3, NOTE_G3, NOTE_CS4,
  NOTE_C4, NOTE_FS4, NOTE_F4, NOTE_E3, NOTE_AS4, NOTE_A4,
  NOTE_GS4, NOTE_DS4, NOTE_B3,  NOTE_AS3, NOTE_A3, NOTE_GS3,0, 0, 0
};
int MarioUW_duration[] = {
 12, 12, 12, 12,12, 12, 6,3,
 12, 12, 12, 12, 12, 12, 6, 3,
 12, 12, 12, 12, 12, 12, 6,
 3, 12, 12, 12, 12,
 12, 12, 6, 6, 18, 18, 18,
 6, 6, 6, 6,6, 6,
 18, 18, 18, 18, 18, 18, 10, 10, 10,
 10, 10, 10, 3, 3, 3
};
//###########End of Mario underworld#############//


//##############**"Titanic" **##############//
int Titanic_note[] = {
NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_E4, NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_E4, NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_E4,
NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_D5, NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_E4, NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_F5,
NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_B4, NOTE_E4,
NOTE_E4, NOTE_B4, NOTE_E5, NOTE_E5, NOTE_E5, NOTE_D5, NOTE_E5, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_D4, NOTE_B3, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_B3, NOTE_E4,
NOTE_D4, NOTE_E4, NOTE_F4, NOTE_G4, NOTE_F4, NOTE_E4, NOTE_E4, NOTE_E4, NOTE_E4


};
int Titanic_duration[] = {
8,8,8,8,8,8,4,8,8,8,8,8,8,4,8,8,8,8,8,8,4,8,8,8,8,4,4,8,8,8,8,8,8,4,8,8,8,8,8,8,4,8,8,8,8,8,8,1,
8,8,8,8,4,4,4,8,4,4,8,8,8,8,4,8,8,4,8,4,8,8,4,8,4,1

};
//###########End of Titanic#############//


void Play_g_tiggers(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(g_tiggers_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / g_tiggers_duration[thisNote];//convert duration to time delay
    NewTone(pin, g_tiggers_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.3; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_birthday(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(birthday_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / birthday_duration[thisNote];//convert duration to time delay
    NewTone(pin, birthday_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.3; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_canon(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(canon_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / canon_duration[thisNote];//convert duration to time delay
    NewTone(pin, canon_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_gourd(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(gourd_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / gourd_duration[thisNote];//convert duration to time delay
    NewTone(pin, gourd_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_happy(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(happy_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / happy_duration[thisNote];//convert duration to time delay
    NewTone(pin, happy_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 0.8; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}
void Play_Pirates(int pin)
{ 
  for (int thisNote = 0; thisNote < (sizeof(Pirates_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / Pirates_duration[thisNote];//convert duration to time delay
    NewTone(pin, Pirates_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.05; //Here 1.05 is tempo, increase to play it slower
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_CrazyFrog(int pin)
{
  for (int thisNote = 0; thisNote < (sizeof(CrazyFrog_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / CrazyFrog_duration[thisNote]; //convert duration to time delay
    NewTone(pin, CrazyFrog_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.30;//Here 1.30 is tempo, decrease to play it faster
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_MarioUW(int pin)
{
    for (int thisNote = 0; thisNote < (sizeof(MarioUW_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / MarioUW_duration[thisNote];//convert duration to time delay
    NewTone(pin, MarioUW_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 1.80;
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}

void Play_Titanic(int pin)
{
    for (int thisNote = 0; thisNote < (sizeof(Titanic_note)/sizeof(int)); thisNote++) {

    int noteDuration = 1000 / Titanic_duration[thisNote];//convert duration to time delay
    NewTone(pin, Titanic_note[thisNote], noteDuration);

    int pauseBetweenNotes = noteDuration * 2.70;
    delay(pauseBetweenNotes);
    NewNoTone(pin); //stop music on pin 8 
    }
}
